
public class CityRecord {

	private String cityName;
	private int xCoordinate;
	private int yCoordinate;

	// Constructor: Accepts x and y coordinates and city name
	public CityRecord (String name, int x, int y)
	{
		cityName = name;
		xCoordinate = x;
		yCoordinate = y;
	}
	   public CityRecord ()
	    {
	        cityName = "";
	        xCoordinate = 0;
	        yCoordinate = 0;
	    }

	// Setters
	public void setCityName(String cName)
	{
		cityName = cName;
	}

	public void setXCoordinate(int x_coor)
	{
		xCoordinate = x_coor;
	}

	public void setYCoordinate(int y_coor)
	{
		yCoordinate = y_coor;
	}


	// Getters
	public String getCityName()
	{
		return cityName;
	}

	public int getXCoordinate()
	{
		return xCoordinate;
	}

	public int getYCoordinate()
	{
		return yCoordinate;
	}

	@Override
	public boolean equals(Object r) {
	    CityRecord record = (CityRecord)r;
	    if(this.getCityName().equals( record.getCityName() )) {
	        if(this.getXCoordinate() == record.getXCoordinate()) {
	            if(this.getYCoordinate() == record.getYCoordinate()) {
	                return true;
	            }
	        }
	    }else return false;
	    return false;

	}


}
